﻿/*
 * Created by SharpDevelop.
 * User: christophe
 * Date: 7/09/2011
 * Time: 20:58
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

namespace MetaVideoEditorEvolved.UI.Entity
{
	using System;
	using System.Windows;
	
	/// <summary>
	/// Description of MediaItemBaseEntity.
	/// </summary>
	public abstract class MediaItemBaseEntity : BaseEntity
	{
		public MediaItemBaseEntity()
		{
		}
		
		bool isCheckedForUpdate;
		
		public bool IsCheckedForUpdate {
			get
			{
				return this.isCheckedForUpdate;
			}
			
			set
			{
				this.isCheckedForUpdate = value;
				
				var folder = this as FolderMediaItem;
				if (folder!=null) {
					foreach (var element in folder.ContentItems) {
						element.IsCheckedForUpdate = value;
					}
				}
				
				var serie = this as SerieMediaItem;
				if (serie!=null) {
					foreach (var element in serie.Seasons) {
						element.IsCheckedForUpdate = value;
					}
				}
				
				var season = this as SeasonMediaItem;
				if (season!=null) {
					foreach (var element in season.Episodes) {
						element.IsCheckedForUpdate = value;
					}
				}
				
				this.OnNotifyPropertyChanged("IsCheckedForUpdate");
			}
		}
		
		string name;
		
		public string Name {
			get
			{
				return this.name;
			}
			
			set
			{
				this.name = value;
				this.OnNotifyPropertyChanged("Name");
			}
		}			
	}
}
